<template>
  <div style="padding: 10px">
    <div style="margin: 10px 0">

      <el-table  :data="tableData" stripe border style="width: 100%">
        <el-table-column type="index" width="50" />
        <el-table-column prop="company" label="公司" > </el-table-column>
        <el-table-column prop="task" label="任务"> </el-table-column>

      </el-table>
    </div>

  </div>

</template>

<script>
import request from "@/utils/request";

export default {
  name: "delivery",
  components:{

  },
  data(){
    return {
      user: {},
      form:{},
      dialogVisible: false,
      search: '',
      currentPage: 1,
      pageSize:10,
      total: 0,
      tableData: [{company:"顺丰",task:0},
        {company:"中通",task:0},
        {company:"申通",task:0},
        {company:"圆通",task:0},
        {company:"韵达",task:0},],
      data:[],
      postage: 0
    }
  },
  created(){
    let userStr = sessionStorage.getItem("user") || "{}"
    this.user = JSON.parse(userStr)
    this.load()
  },
  methods: {
    load() {
      request.get("/user/query", {
        params: {
          pageNum: this.currentPage,
          pageSize: this.pageSize,
          search: this.search
        }

      }).then(res => {
        console.log(res)
        this.data= res.data
       for(let i=0;i<this.data.length;i++){
         this.tableData[i].task= this.data[i]
       }
        this.total = res.data.total
      })
    },


    handleSizeChange(pageSize) {   //改变当前每页的个数
      this.pageSize=pageSize
      this.load()
    },
    handleCurrentChange(pageNum) {   //改变当前页数
      this.currentPage=pageNum
      this.load()
    }


  }


}
</script>

<style scoped>

</style>